package com.bw.zhuangao5___day002.Fragment.Music;

import com.bw.mvp.M.BannerModel;

import java.util.List;

import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.Disposable;
import io.reactivex.schedulers.Schedulers;

/**
 * create by ertu
 * create on 2021/9/24
 * description
 */
public class MuiscModel extends BannerModel implements MuiscContion.mismodel {


    @Override
    public void getmismodel(String name, MuiscCllback muiscCllback) {
        MuiscOkhttps.getMuiscOkhttps().retrofition(MuiscApi.XIAN_SHENG).create(MuiscApi.class).getjavamuisc(name)
                .observeOn(AndroidSchedulers.mainThread())
                .subscribeOn(Schedulers.computation())
                .subscribe(new Observer<JavaMuisc>() {
                    @Override
                    public void onSubscribe(Disposable d) {

                    }

                    @Override
                    public void onNext(JavaMuisc javaMuisc) {
                        List<JavaMuisc.DataBean> dataBeans = javaMuisc.getData();
                        muiscCllback.suummc(dataBeans);
                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onComplete() {

                    }
                });
    }
}
